//while循环

function fn() {
    let circles = 0;
    let flag = 'y';
    while (1) {
        circles++;
        alert(`开始跑第${circles}圈`);
        alert('跑了几分钟了');
        flag = prompt('还可以继续跑吗？(y/n)');
        if (flag !== 'y' && flag !== 'Y') {
            break;
        }
    }
    document.write(`你跑了${circles}圈，共跑了${circles * 440}米`);
}
fn()